package com.coc.controller;

import com.coc.DTO.User;
import com.coc.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class RedisController {

    @Autowired
    private RedisService redisService;


    @RequestMapping("/setValue")
    public void setValue () {
        redisService.setValue();
    }

    @RequestMapping("getUser")
    public User getUser () {
        return redisService.getUserFromRedis();
    }

    @RequestMapping("/getValue")
    public String getValue () {
        return redisService.getValue();
    }

    @RequestMapping("/deleteValue")
    public String deleteValue() {
        return redisService.deleteValue();
    }

    @RequestMapping("/hello")
    public void hello () {
        System.out.println("hello");

    }

}
